#include <iostream>
#include <vector>
#include <string>

using namespace std;

vector<int>  pascal(int numRows)
{
  std::vector<int>  e;

  if(numRows<0)
    return e;

  if( numRows<2 )
  {
       std::vector<int> o(numRows+1,1);
       return o;
  }
  
   std::vector<int> t = pascal(numRows-1);
   std::vector<int> ret(numRows+1,1);
   for(int i=1;i<numRows;++i)
   {
     ret[i] = t[i-1] + t[i];
   }

  return ret;
}

int main(int argc,char *argv[])
{
  int numRows=10;  //0,1,5,1000

  for(int i=0;i<10;++i)
  {
   vector<int> ret = pascal(i);



   cout<<"----------rowIndex="<<i<<"----------"<<endl;
  cout<<"[" ;
  for(std::vector<int>::iterator iter=ret.begin();
      iter!=ret.end(); ++iter )
  {
    cout<< *iter<<",";

  }
  cout<<"]"<<endl<<endl;


  }


  

  return 0;


}
